package com.problem;

/**
 * https://leetcode-cn.com/problems/container-with-most-water/
 */
public class MaxArea {
    public int maxArea(int[] height) {
        int x = 0;
        int n = 0;
        for (int i=0;i<height.length-1;i++) {
            for (int j=i+1;j<height.length;j++) {
                n = (j-i)*(height[i] > height[j]?height[j]:height[i]);
                //System.out.println("i:"+i+" j:" + j+" n:"+n);
                if (x >= n) {
                    continue;
                }
                x = n;
            }
        }
        return x;
    }
}
